//引入路由 14：14
import React from 'react';
//一级
const Index = React.lazy(() => import('../views/Index'));
const Detail = React.lazy(() => import('../views/Detail'));
const Login = React.lazy(() => import('../views/Login'));
const Classfind = React.lazy(() => import('../views/Classfind'));

//二级
const Home = React.lazy(() => import('../views/two/Home'));
const Zhunt = React.lazy(() => import('../views/two/Zhunt'));
const Class = React.lazy(() => import('../views/two/Class'));
const Car = React.lazy(() => import('../views/two/Car'));
const My = React.lazy(() => import('../views/two/My'));


//路由表
const routes =[
    {
        path:'/index',
        component:Index,
        children:[
            {
                path:'/index/home',
                component:Home,
            },{
                path:'/index/zhuant',
                component:Zhunt,
            },{
                path:'/index/class',
                component:Class,
            },{
                path:'/index/car',
                component:Car,
            },{
                path:'/index/my',
                component:My,
            },{
                from:'/index',
                to:'/index/home'
            },
        ]
    },{
        path:'/detail/:id',
        component:Detail,
    },{
        path:'/login',
        component:Login,
    },{
        path:'/classfind',
        component:Classfind,
    },{
        from:'/',
        to:'/index'
    },
]

export default routes
//14:18

